<?php
/**
 * Created by PhpStorm.
 * User: 戎大富
 * Date: 2019/1/23
 * Time: 18:10
 */
namespace app\admin\controller;
use think\Db;
class Contact  extends Base {

    public function index(){
        if(request()->isPost()){
            $id = input('param.id');
            $phone = input('param.phone');
            $info = Db::table('up_phone')->where('up_phone_id',$id)->setField('up_phone',$phone);
            if($info){
                return ['code' => 200, 'data' =>"", 'msg' => '编辑成功'];
            }else{
                return ['code' => 100, 'data' => '', 'msg' => '编辑失败'];
            }
        }
        $res = Db::table('up_phone')->find();
        $this->assign('res',$res);
        return $this->fetch();
    }
}